from wxauto import WeChat
from names import get_names
import pandas as pd

wx = WeChat()

# 读取Excel文件
# file_path = 'C:/Users/Administrator/Desktop/上课通知.xlsx'
# df = pd.read_excel(file_path)
# # 获取第一列数据（索引为0）
# first_column = df.iloc[:, 0]  # iloc用于基于索引的位置访问
# print(first_column)

name_list = get_names()
name_list_len = len(name_list)
counter = 0
# print(name_list)
for item in name_list:
    msg = item['name'] + item['time'] + '，地址：苍溪县金港国际3楼码高教育，请提前10分钟到校，给宝贝带好水杯哦！'
    wx.SendMsg(msg=msg, who=item['nickName'])
    counter += 1

if name_list_len == counter:
    print("消息发送完成！共发送" + str(counter) + "条。")


